package com.hopu.product.util;


import java.sql.Connection;
import java.sql.PreparedStatement;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 * 数据库连接工具类
 *
 */
public class DBUtil {
	
	static Connection conn;
	static PreparedStatement pst;

	public static PreparedStatement getPst(String sql){
		try {
			conn=C3P0Util.getConnection();
			pst = conn.prepareStatement(sql);
		} catch (SQLException e) {
			e.printStackTrace();
		}
		
		return pst;
	}
	
	public static void close(ResultSet rs){
		C3P0Util.close(rs, pst, conn);
		
	}
}
